/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


package learn.round1C;

import java.io.IOException;
import static chanlib.Chan_Math.C;
import static chanlib.Chan_Math.nCr;
import static chanlib.Chan_IO.*;
import static java.lang.Math.min;
import static java.lang.Math.max;
/**
 * @author Expression author is undefined on line 14, column 14 in Templates/Classes/Class_1.java.
 */
public class LoadTesting{
    /*
      All neccesary to be defined
      including:
      variable, inner class
    */
    // static int A;
    // static void B();
    // static class C
    static int f[] = new int[31];

    /*
       One calculation fits all of the cases.
    */
    static void preReckon(){
        for(int n=1;n<31;n++){
            f[n]=Integer.MAX_VALUE;
            for(int k=1;k<=n;k++){
                f[n]=min(f[n],max(f[k-1],f[n-k]));
            }
            f[n]++;
        }
//        for(int n=0;n<31;n++){
//            System.out.printf("at %d, %d \n",n,f[n]);
//        }
        return;
    }

    /*
      calculate the answer
    */
    private static int reckon() {
        long L=Int();
        long P=Int();
        int C=Int();
        int j=0;
        while((L*=C)<P)j++;
        return f[j];
    }


    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        /*
           Pre-computing for all cases
        */

        // Just in case!
        preReckon();
        //while((char)read()!='P');

        /*
          Input-output
        */
        boolean test=false;
        boolean small=false;
        String prob="B";
        String filename;
        if(test) filename="test";
        else{
            if(small) filename=prob+"-small-practice";
            else filename=prob+"-large-practice";
        }
        try {
            /*
               Init IO,plus determination of input line number
             */
            int lineNums = initFileIO(filename);
            for (int i = 1; i <= lineNums; i++) {
                writeln("Case #" + i + ": "+reckon(),OUTFILE);
            }
        } finally {
            endIO();
        }
    }

}
